Exp=x
ModuleFileName=Function_1.cs
@end
                                        
//´칤Զɣѡ񡰹ܼģ顱
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

	/// <summary>
	/// </summary>
	public class @ytclass
	{
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int FindPort_3(string filename,int start,  StringBuilder OutKeyPath);
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int FindPort_4(string filename,int start, string HKey,string LKey, StringBuilder OutKeyPath);
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int Cal_2(string filename,int start, int pos,ref short a,ref short b,ref short c,ref short d, string KeyPah,int cycle);
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int CalculateEx_3(string filename,int start, int pos,ref short a,ref short b,ref short c,ref short d, string KeyPah,int cycle);
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int E_Ex_3(string HKey,string LKey,string filename, string filename_lll,string KeyPah);
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int  ConnectServer (string servername, int port);
		[DllImport ("ClientKeyDll.dll")]
		public static extern  int  DisconnectServer ();
		[DllImport ("ClientKeyDll.dll")]
		public static extern  void  AutoDisConnect(uint timer,bool biao);
		private static int LastError;
		private static string KeyPath ;
		
		
		public @ytclass()
		{
			LastError = 0; //ʼΪ޴
		}
		//'ServerConnect
		//'Ŀģӷ
		//'1servername ҪӵķƻIPַ
		//'2port Ӷ˿,˿ںſԶ
		//'ؽ0ʾɹӷʾʧ
		//'ע⣺ʹκκ֮ǰһҪȵøúini֮ǰڳ˳ʱмһҪʹDisConnectServerϿ
		public int ServerConnect(string servername, int port )
		{
			LastError=ConnectServer(servername,port);
			if (LastError!=0 ) 
			{
		  		MessageBox.Show( "ӷ򣬴Ϊ" + LastError.ToString());
			}
			AutoDisConnect(60000, true); //ڳʱԶϿЧӣʱʱΪ60
			return LastError;
		}

		//'ServerDisConnect
		//'ĿģϿ
		//'ؽ0ʾɹϿʾʧ
		//'ע⣺ڳ˳ʱмһҪʹDisConnectServerϿ
		public int ServerDisConnect()
		{
		      return DisconnectServer();
		}
		//YGetLastError
		//ĿģȡĴ룬Ϊ0ʾûд
		//ؽĴ
		public  int YGetLastError()
		{
			return LastError;
		}
		#f_ini#
		#f_ini_3#
		#f_Ystrcat#
		#f_YCompareString#
		#f_Ystrcpy#
		#f_YAdd#
		#f_YSetValue#
		#f_YDivide#
		#f_Ymultiply#
		#f_YDecrease#
		#f_compare#
		#f_CheckKey#
		#f_Yor#
		#f_YAnd#	
		
	}

